<template>
  <van-popup
    v-model="show"
    :show-confirm-button="false"
    :close-on-click-overlay="true"
    class="sharePopup"
    position="top"
    get-container="body"
    @click-overlay="closeModal"
  >
    <div class="sharePopupCon">
      <div class="arrowFlex">
        <div class="arrowCon">
          <img :src="shareArrow" alt="" />
        </div>
      </div>
      <div class="shareTipsModalBody">
        <div class="iconCon"><van-icon name="close" @click="closeModal" /></div>
        <div class="content">
          您还未转发，转发本活动链接到朋友圈/微信群后，可参加大转盘抽奖，当天可获得3次/人抽奖机会哦！
        </div>
        <div class="btnCon">
          <van-button class="tipsBtn" round @click="closeModal"
            >立即转发</van-button
          >
        </div>
      </div>
    </div>
  </van-popup>
</template>

<script>
import { Dialog, Button, Icon, Popup } from "vant";
import shareArrow from "@/assets/切图/转发箭头.png";
export default {
  components: {
    [Dialog.Component.name]: Dialog.Component,
    [Button.name]: Button,
    [Icon.name]: Icon,
    [Popup.name]: Popup,
  },
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      show: false,
      shareArrow,
    };
  },
  watch: {
    visible: {
      immediate: true,
      handler(val) {
        this.show = val;
      },
    },
  },
  methods: {
    closeModal() {
      this.$emit("close-modal");
    },
  },
};
</script>

<style lang="scss">
.sharePopup {
  background: transparent;
  padding-top: 50px;
  .sharePopupCon {
    width: 100vw;
    .sharePopupImg {
      width: 100%;
    }
    .arrowFlex {
      display: flex;
      justify-content: space-between;
      position: relative;
      height: 400px;
      .arrowCon {
        position: absolute;
        top: 0;
        right: 50px;
        img {
          display: block;
          height: 400px;
          width: 300px;
        }
      }
    }
  }
}
.shareTipsModalBody {
  margin: 40px 200px 36px 200px;
  padding: 24px;
  border-radius: 20px;
  background-color: white;
  .iconCon {
    text-align: right;
  }
  .content {
    padding: 12px;
  }
  .btnCon {
    text-align: center;
    padding-top: 24px;
  }
  .tipsBtn {
    background-image: linear-gradient(to right, #d45d60, #b60e11);
    color: white;
    width: 30vw;
    height: 100px;
  }
}
</style>